package cn.wgoodq.service.userService.impl;

import cn.wgoodq.domain.Result;
import cn.wgoodq.domain.User;
import cn.wgoodq.service.userService.UserService;
import org.springframework.stereotype.Service;

/**
 * Created by OuKyou on 2017/1/15.
 */
@Service
public class UserServiceImpl implements UserService {
    @Override
    public Result<User> signin(User user) {

        if (user.getUserId().equalsIgnoreCase("admin") && user.getPassWd().equalsIgnoreCase("admin")) {
            // 登录成功
            user.setUserName("admin");
            return new Result<>(true, user, "");
        }

        // 没登录成功
        return new Result<>(false, null, "错误的帐号或密码！");
    }
}
